<?php
/* @var $this CategorysController */
/* @var $model Categorys */

$this->breadcrumbs = array(
    '栏目管理' => array('index'),
    '列表',
);

$this->menu = array(
    array('label' => '新建栏目', 'url' => array('create')),
    array('label' => '高级搜索', 'url' => 'javascript:void(0)', 'linkOptions' => array(
            'class' => 'search-button'
    )),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('categorys-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<h1>栏目列表</h1>
<div class="search-form" style="display:none">
    <?php
    $this->renderPartial('_search', array(
        'model' => $model,
    ));
    ?>
</div><!-- search-form -->

<?php
$this->widget('zii.widgets.grid.CGridView', array(
    'id' => 'categorys-grid',
    'dataProvider' => $model->search(),
    //'filter'=>$model,
    'columns' => array(
        'id',
       
        'category_name',
         array(
            'name' => 'category_parent',
            'value' => 'Categorys::model()->parentName($data->category_parent)',
        ),
        'category_alias',
        array(
            'name' => 'category_model',
            'value' => 'Categorys::model()->category_model_array[$data->category_model]',
        ),
        array(
            'name' => 'category_type',
            'value' => 'Categorys::model()->category_type_array[$data->category_type]',
        ),
        array(
            'name' => 'category_ismenu',
            'value' => 'Categorys::model()->menu_array[$data->category_ismenu]',
        ),
        'category_order',
        /*
          'category_content',
          'seo_title',
          'seo_keywords',
          'seo_description',
          'category_status',
          
         */
        array(
            'class' => 'CButtonColumn',
        ),
    ),
));
?>
